package com.christodoulou.placesfinder;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class Start extends Activity {
	
	EditText bussinessName;
	EditText bussinessType;
	EditText bussinessCity;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_start);
		
		// Edit Text
        bussinessName = (EditText) findViewById(R.id.bussinessName);
        bussinessType = (EditText) findViewById(R.id.bussinessType);
        bussinessCity = (EditText) findViewById(R.id.bussinessCity);
        
      
        
     // Create button
        Button btnSearch = (Button) findViewById(R.id.SearchBtn);
 
        // button click event
        btnSearch.setOnClickListener(new View.OnClickListener() {
 
            @Override
            public void onClick(View view) {
            	//Intent intent = new Intent(getApplicationContext(), BussinessFinder.class);
				//startActivity(intent);
            	
            	
	             
           
				Intent in = new Intent(getApplicationContext(), BussinessFinder.class);
              
				String name = bussinessName.getText().toString();
				String type = bussinessType.getText().toString();
				String city = bussinessCity.getText().toString();
	              in.putExtra("name", name);
	              in.putExtra("type",type);
	              in.putExtra("city",city);
	              startActivity(in);
	                
	                
	              

            
            }
        });
        
	}

	}


